<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script src="../node_modules/@vue/runtime-dom/dist/runtime-dom.global.js"></script>
    <div id="app"></div>
    <script>
        const { reactive, watch,watchEffect } = VueRuntimeDOM;

        const state = reactive({count:0})
        debugger
        watch(() => state.count,(newVal,oldVal) => {
            console.log(newVal,oldVal);
        },/*{immediate:true}*/)
        state.count = 1
        // watchEffect(() => {
        //     console.log(state.count);
        // })

        // setTimeout(()=>{
        //     state.count++
        //     state.count++
        //     state.count++ 
        // },1000)
    </script>
</body>

</html>